# from django.shortcuts import render
#
# # Create your views here.
# from rest_framework.views import APIView
# from rest_framework.response import Response
# from django.core import serializers
# import json
#
# from users.models import CollegeModel, ProfessionalModel
#
# """
# user_num = 202101010101
# """
#
#
# # 查询课程
# class QueryCourseView(APIView):
#     def post(self, request, *args, **kwargs):
#         user_num = request.POST['user_num']
#         if len(user_num) == 0:
#             data = {
#                 'code': 4000,
#                 'msg': "没有找到"
#             }
#             return Response(data)
#         else:
#             #
#             college_num = user_num[4:5]
#             professional_num = user_num[6:7]
#             grade_num = user_num[8:9]
#             class_num = user_num[10:11]
#             c1 = CollegeModel.objects.filter(number=college_num)[0]
#             c2 = json.loads(serializers.serialize("json", c1))['pk']
#             p1 = ProfessionalModel.objects.filter(number=professional_num,college=c2)[0]
#             p2 = json.loads(serializers.serialize("json",p1))['pk']
